package com.ibeetl.cms.service;


import com.alipay.api.domain.DeviceInfo;
import com.ibeetl.cms.dao.XxdOrderDao;
import com.ibeetl.cms.entity.XxdOrder;



import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import org.beetl.sql.core.SQLReady;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;






/**
 * XxdOrder Service
 */

@Service
@Transactional
public class XxdOrderService extends CoreBaseService<XxdOrder>{

    @Autowired private XxdOrderDao xxdOrderDao;

    public PageQuery<XxdOrder>queryByCondition(PageQuery query){
        PageQuery ret =  xxdOrderDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelXxdOrder(List<Long> ids){
        try {
            xxdOrderDao.batchDelXxdOrderByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除XxdOrder失败", e);
        }
    }

    public List<XxdOrder> getById(String id){
        return sqlManager.execute(new SQLReady("select * from xxd_order d where d.order_id = ? "
                ,id),XxdOrder.class);
    }
}